<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title></title>
    <link rel="stylesheet" type="text/css" href="./css/api.css" />
    <link rel="stylesheet" type="text/css" href="./css/style.css" />
    <link rel="stylesheet" type="text/css" href="./css/iconfont.css" />
    <style type="text/css">
      #App{height:100%; background:#f2f2f2;}
      .more{line-height:100px; padding-top:4px;}
      .more i{font-size:25px;}
    </style>
</head>
<body>
  <div id="App" class="row-flex">
      <div id="header" class="header dflex">
          <div class="icon"></div>
          <div class="title flex-1 text-overflow">语音导览系统</div>
          <div class="icon more" onclick="gotoLogin();"><i class="iconfont icon-pinglun2"></i></div>
      </div>
      <div id="main" class="main flex-1 flex-con"></div>
  </div>
</body>
<script type="text/javascript" src="./script/api.js"></script>
<script type="text/javascript">
    apiready = function(){

      var header = $api.byId('header');
      $api.fixStatusBar(header);
      api.setStatusBarStyle({style:'dark'});

      var headerPos = $api.offset(header);
      var main = $api.byId('main');
      var mainPos = $api.offset(main);

      openMain({
          x: 0,
          y: headerPos.h,
          w: 'auto',
          h: mainPos.h
      });

      api.addEventListener({
          name: 'reloadEvent'
      }, function(ret, err) {
        api.closeFrame({name: 'main'});
        openMain({
            x: 0,
            y: headerPos.h,
            w: 'auto',
            h: mainPos.h
        });
      });

    };
    function openMain(rect){
      api.openFrame({
          name: 'main',
          url: './html/main.html',
          bounces: true,
          rect: rect
      });
    }
    function gotoLogin(){
      api.openWin({
          name: 'Login',
          url: './html/Login.html',
          pageParam: {name: 'test'}
      });
    }
</script>
</html>
